package com.woniu.controller;

import com.woniu.service.UserAddressService;
import com.woniu.util.R;
import com.woniu.vo.AddressVoCZT;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("userAddress")
@Api(value = "收货地址接口", tags = "收货地址功能")
public class UserAddressController {
    @Resource
    private UserAddressService uas;

    @ApiOperation("根据用户id查询收货地址")
    @GetMapping("selectAllAddressByAccountId")
    public R selectAllAddressByAccountId(int accountId) {
        List<AddressVoCZT> list = uas.selectAllAddressByAccountId(accountId);
        return R.build(200, "查询成功", list);
    }
}
